﻿using ERP.Framework.Components.SortingHelper;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ERP.Framework.Components.SortingHelper.Interfaces;
using System.Collections;

namespace ERP.Framework.Components.Testing.SortHelper.Test
{   
    /// <summary>
    ///This is a test class for SortingManagerTest and is intended
    ///to contain all SortingManagerTest Unit Tests
    ///</summary>
    [TestClass()]
    public class SortingManagerTest
    {
        private void InitializeArrayItems(ref ArrayList array)
        {
            array.Add(1); 
            array.Add(2); 
            array.Add(0); 
            array.Add(-1); 
            array.Add(9);
            array.Add(10);
            array.Add(114);
        }
        /// <summary>
        ///A test for SortList
        ///</summary>
        [TestMethod()]
        public void SortListTest()
        {
            ArrayList array = new ArrayList(), sortedList = new ArrayList(); 
            // TODO: Initialize to an appropriate value

            InitializeArrayItems(ref array);
            InitializeArrayItems(ref sortedList);

            //Sort list
            SortingManager.SortList(sortedList);

            //TODO: Set Tests
            Assert.AreEqual(sortedList[0], array[3]);
        }
        
        /// <summary>
        ///A test for CurrentSortAlgorithm
        ///</summary>
        [TestMethod()]
        public void CurrentSortAlgorithmTest()
        {
            Assert.IsNotNull(SortingHelper.SortingManager.CurrentSortAlgorithm);            
        }
    }
}
